package com.swjd.controller;

import com.swjd.dao.TmumberDao;
import com.swjd.pojo.Tmumber;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class TmumberController {
    @Autowired
    private TmumberDao tmumberDao;
    @RequestMapping("/index/{id}")
    public String MemberList(Model model,@PathVariable String id) {
        Tmumber tmumber = new Tmumber();
        tmumber.setId(id);
        tmumber.setStatus("审核通过");
        tmumberDao.updateById(tmumber);
        return "redirect:/index";
    }
    @RequestMapping("/index")
    public String MemberList(Model model) {
        List<Tmumber> tmumbers = tmumberDao.selectList(null);
        model.addAttribute("tmumbers",tmumbers);
        return "MemberList";
    }
}
